package com.ugoodtech.mdcc.core.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.Date;

@ApiModel("报告问卷")
@Entity
@Table(name = "station_report")
public class StationReport extends BaseEntity {

    @ApiModelProperty("创建报告人")
    private User user;

    @ApiModelProperty("维修站")
    private Station station;

    @ApiModelProperty("报告状态,unfinshed:暂存,complete:提交")
    private String reportType;

    @ApiModelProperty("部门待确认状态")
    private String specifiedType;

    @ApiModelProperty("负责人待处理状态")
    private String exceptionType;

    @ApiModelProperty("被指定人的IDs")
    private String userIds;

    @ApiModelProperty("指定的部门IDs")
    private String deparmentIds;

    @ApiModelProperty("报告的类型")
    private String reportCategory;

    @ApiModelProperty("满意度报告分数")
    private Integer score;

    @ApiModelProperty("报告类型")
    private String category;

    @ApiModelProperty("服务项目答案ID")
    private String serviceTypAnswerIds;

    @ApiModelProperty("技术颜色报告审核")
    private String auditing;

    @ApiModelProperty("技术颜色报告审核不通过的原因")
    private String auditNote;

    @ApiModelProperty("是否已经确认过")
    private boolean adminReaded = false;

    @ApiModelProperty("服务开始时间")
    private Date startServiceTime;

    @ApiModelProperty("服务结束时间")
    private Date endServiceTime;

    @ApiModelProperty("服务开始时间")
    private String serviceStartTime;

    @Column(name = "start_service_time",  insertable = false, updatable = false)
    public String getServiceStartTime() {
        return serviceStartTime;
    }

    public void setServiceStartTime(String serviceStartTime) {
        this.serviceStartTime = serviceStartTime;
    }

    @Column(name = "end_service_time",  insertable = false, updatable = false)
    public String getServiceEndTime() {
        return serviceEndTime;
    }

    public void setServiceEndTime(String serviceEndTime) {
        this.serviceEndTime = serviceEndTime;
    }

    @ApiModelProperty("服务结束时间")
    private String serviceEndTime;

    @ApiModelProperty("联系人的电话")
    private String contactUser;

    @ApiModelProperty("是否需要其他部门跟进")
    private boolean isfollowed = false;

    @ApiModelProperty("改善月-时间戳")
    private Long improvementTime;

    @ApiModelProperty("补充信息的维修站ID")
    private Long temporaryStationId;

    @ApiModelProperty("是否重复提交")
    private boolean reAudit = false;

    @ApiModelProperty("服务项目多选题")
    private String answerOther;

    @ApiModelProperty("是否是补充资料的维修站 默认为false")
    private boolean isSupplement = false;

    @ApiModelProperty("最新的处理状态")
    private String type;

    @ApiModelProperty("最新修改者")
    private User editUser;

    @ApiModelProperty("提交者用户身份")
    private Integer userType;

    @Column(name = "user_id", insertable = false, updatable = false)
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    private Long userId;

    @Column(name = "station_id", insertable = false, updatable = false)
    public Long getStationId() {
        return stationId;
    }

    public void setStationId(Long stationId) {
        this.stationId = stationId;
    }

    private Long stationId;

    @ManyToOne
    @JoinColumn(name = "user_id")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @ManyToOne
    @JoinColumn(name = "station_id")
    public Station getStation() {
        return station;
    }

    public void setStation(Station station) {
        this.station = station;
    }

    @Column(name = "report_type")
    public String getReportType() {
        return reportType;
    }

    public void setReportType(String reportType) {
        this.reportType = reportType;
    }

    @Column(name = "specified_type")
    public String getSpecifiedType() {
        return specifiedType;
    }

    public void setSpecifiedType(String specifiedType) {
        this.specifiedType = specifiedType;
    }

    @Column(name = "exception_type")
    public String getExceptionType() {
        return exceptionType;
    }

    public void setExceptionType(String exceptionType) {
        this.exceptionType = exceptionType;
    }

    @Column(name = "user_ids")
    public String getUserIds() {
        return userIds;
    }

    public void setUserIds(String userIds) {
        this.userIds = userIds;
    }

    @Column(name = "report_category")
    public String getReportCategory() {
        return reportCategory;
    }

    public void setReportCategory(String reportCategory) {
        this.reportCategory = reportCategory;
    }

    @Column(name = "score")
    public Integer getScore() {
        return score;
    }

    public void setScore(Integer score) {
        this.score = score;
    }

    @Column(name = "category")
    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    @Column(name = "service_type_id")
    public String getServiceTypAnswerIds() {
        return serviceTypAnswerIds;
    }

    public void setServiceTypAnswerIds(String serviceTypAnswerIds) {
        this.serviceTypAnswerIds = serviceTypAnswerIds;
    }


    @Column(name = "auditing")
    public String getAuditing() {
        return auditing;
    }

    public void setAuditing(String auditing) {
        this.auditing = auditing;
    }

    public String getDeparmentIds() {
        return deparmentIds;
    }

    public void setDeparmentIds(String deparmentIds) {
        this.deparmentIds = deparmentIds;
    }

    @Column(name = "admin_readed")
    public boolean isAdminReaded() {
        return adminReaded;
    }

    public void setAdminReaded(boolean adminReaded) {
        this.adminReaded = adminReaded;
    }


    @Column(name = "start_service_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
    public Date getStartServiceTime() {
        return startServiceTime;
    }

    public void setStartServiceTime(Date startServiceTime) {
        this.startServiceTime = startServiceTime;
    }

    @Column(name = "end_service_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
    public Date getEndServiceTime() {
        return endServiceTime;
    }

    public void setEndServiceTime(Date endServiceTime) {
        this.endServiceTime = endServiceTime;
    }

    @Column(name = "contact_user")
    public String getContactUser() {
        return contactUser;
    }

    public void setContactUser(String contactUser) {
        this.contactUser = contactUser;
    }

    @Column(name = "audit_note")
    public String getAuditNote() {
        return auditNote;
    }

    public void setAuditNote(String auditNote) {
        this.auditNote = auditNote;
    }

    @Column(name = "is_followed")
    public boolean isIsfollowed() {
        return isfollowed;
    }

    public void setIsfollowed(boolean isfollowed) {
        this.isfollowed = isfollowed;
    }

    @Column(name = "improvement_time")
    public Long getImprovementTime() {
        return improvementTime;
    }

    public void setImprovementTime(Long improvementTime) {
        this.improvementTime = improvementTime;
    }

    @Column(name = "temporary_station_id")
    public Long getTemporaryStationId() {
        return temporaryStationId;
    }

    public void setTemporaryStationId(Long temporaryStationId) {
        this.temporaryStationId = temporaryStationId;
    }

    @Column(name = "re_audit")
    public boolean isReAudit() {
        return reAudit;
    }

    public void setReAudit(boolean reAudit) {
        this.reAudit = reAudit;
    }

    @Column(name = "answer_other")
    public String getAnswerOther() {
        return answerOther;
    }

    public void setAnswerOther(String answerOther) {
        this.answerOther = answerOther;
    }

    @Column(name = "is_supplement")
    public boolean isSupplement() {
        return isSupplement;
    }

    public void setSupplement(boolean supplement) {
        isSupplement = supplement;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @ManyToOne
    @JoinColumn(name = "edit_user_id")
    public User getEditUser() {
        return editUser;
    }

    public void setEditUser(User editUser) {
        this.editUser = editUser;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }
}
